﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace Config
{
    public class omplconfig_sys : BaseNode
    {
        public omplconfig_sys(XmlNode node) : base(node)
        {

        }
        public string IP
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                return _xmlNode["IP"].InnerText;
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("IP");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("IP"));
                Node.InnerText = value.ToString();
            }
        }
        public string UploadFilePath
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                return _xmlNode["UploadFilePath"].InnerText;
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("UploadFilePath");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("UploadFilePath"));
                Node.InnerText = value.ToString();
            }
        }
        public string UserName
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                return _xmlNode["UserName"].InnerText;
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("UserName");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("UserName"));
                Node.InnerText = value.ToString();
            }
        }
        public string Key
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                return _xmlNode["Key"].InnerText;
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("Key");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("Key"));
                Node.InnerText = value.ToString();
            }
        }
        //<strIP1>192</strIP1>
        public int IP1
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["strIP1"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strIP1");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strIP1"));
                Node.InnerText = value.ToString();
            }
        }
        //<strIP2>168</strIP2>
        public int IP2
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["strIP2"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strIP2");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strIP2"));
                Node.InnerText = value.ToString();
            }
        }
        //<strIP3>2</strIP3>
        public int IP3
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["strIP3"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strIP3");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strIP3"));
                Node.InnerText = value.ToString();
            }
        }
        //<strIP4>64</strIP4>
        public int IP4
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["strIP4"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strIP4");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strIP4"));
                Node.InnerText = value.ToString();
            }
        }
        //<strPort>250</strPort>
        public int Port
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["strPort"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strPort");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strPort"));
                Node.InnerText = value.ToString();
            }
        }
        //<nRefreshIndex>0</nRefreshIndex>
        public int nRefreshIndex
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["nRefreshIndex"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("nRefreshIndex");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("nRefreshIndex"));
                Node.InnerText = value.ToString();
            }
        }
        //<nSampleMode>0</nSampleMode>
        public int nSampleMode
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["nSampleMode"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("nSampleMode");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("nSampleMode"));
                Node.InnerText = value.ToString();
            }
        }
    }
}
